<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="./inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="选择日期" />
<%@ include file="./inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function checkInput(){
		if(window.event.keyCode==13){
			doOk();
		}
	}
	function doOk(){
		var startDate=document.getElementById("start_date").value;
		if(startDate!=null && startDate!=''){
			var arr=startDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return;
			}
		}
		
		var endDate=document.getElementById("end_date").value;
		if(endDate!=null && endDate!=''){
			var arr=endDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return;
			}
		}
		
		var retArr=new Array();
		retArr[0]=startDate;
		retArr[1]=endDate;
		parent.popRetVal=retArr;
		parent.ClosePop();
	}
	function doCancel(){
		parent.ClosePop();
	}
</script>
</head>
<body oncontextmenu="return false"  class="sheet modal-dialog" style="padding-top:10px;text-align:left;">
<div class="sheet-main"  style="width:315px;">
	  <div class="sheet-list" >
	    <div class="modal-main search-business">
	    	<div style="width:100%;">
				<c:set var="pageTopTitle" value="${title}" />
				<c:set var="pageTopMark" value="格式：2008-01-01" />
				<%@ include file="./inc/PageTop.jsp"%>
				<table border="0" cellspacing="1" cellpadding="1" align="center" class="table-a">
						<tr>
							<th>开始日期：</th>
							<td>
								<input type="text"  class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" id="start_date" name="start_date" value="${start_date}">
								<img src="/images/calendar.gif" style="cursor:pointer" onClick="displayCalendar(document.getElementById('start_date'),'yyyy-mm-dd',document.getElementById('start_date'));">							</td>
						</tr>	
						<tr>
							<th>结束日期：</th>
							<td>
								<input type="text"  class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" id="end_date" name="end_date" value="${end_date}">
								<img src="/images/calendar.gif" style="cursor:pointer" onClick="displayCalendar(document.getElementById('end_date'),'yyyy-mm-dd',document.getElementById('end_date'));">
						</tr>	
				</table>
			</div>
	  	</div>
	  </div>
		<div class="modal-buttom">
			<input type="button" class="buttom-a" value=" 确 定 " onClick="doOk();">
			<input type="button" class="buttom-a" value=" 取 消 " onClick="doCancel();">
		</div>
</div>			   	
</body>
</html>